package exception;

import java.util.Scanner;

public class ThrowsDemo {
    public static void main(String[] args) {
        Student zs = new Student();
      //  Scanner scan= new Scanner(System.in);
      //  int age = scan.nextInt();
      //  while (true) {
            try {
                zs.setAge(10);
                System.out.println("年龄是" + zs.getAge());
               // break;
            } catch (IllegalAgeException e) {
                System.out.println(e.getMessage());
              //  System.out.println("请重新输入");
               // age = scan.nextInt();
          //  }

        }

    }
}
